package com.czy.owner.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.czy.owner.R;
import com.czy.owner.entity.HotShopClassifyModel;
import com.czy.owner.entity.ShoppingModel;
import com.czy.owner.utils.glide.GlideUtils;
import com.easyrecycleview.adapter.BaseViewHolder;
import com.easyrecycleview.adapter.RecyclerArrayAdapter;

import org.xutils.image.ImageOptions;
import org.xutils.x;

/**
 * Created by asus on 2017/12/19.
 */

public class ShoppingRecommendBrandAdapter  extends RecyclerArrayAdapter<ShoppingModel.GoodsBrandRecommendListBean> {



    public ShoppingRecommendBrandAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new ShoppingRecommendBrandAdapter.HotShopClassifyHolder(parent);
    }


    @Override
    public void OnBindViewHolder(BaseViewHolder holder, int position) {
        super.OnBindViewHolder(holder, position);
    }



    class HotShopClassifyHolder extends BaseViewHolder<ShoppingModel.GoodsBrandRecommendListBean> {
        private ImageView ivClassify;

        public HotShopClassifyHolder(ViewGroup parent) {
            super(parent, R.layout.item_shopping_brand_recommend);
            ivClassify = $(R.id.iv_classify);
        }

        @Override
        public void setData(ShoppingModel.GoodsBrandRecommendListBean model) {
            super.setData(model);
            x.image().bind(ivClassify,model.getLogo(), new ImageOptions.Builder()
                    .setFailureDrawableId(R.mipmap.default_icon)
                    .setLoadingDrawableId(R.mipmap.default_icon)
                    .build());

        }


    }



}

